package edu.seu.mart.service.impl;

import edu.seu.mart.dao.IAddressDao;
import edu.seu.mart.model.Address;
import edu.seu.mart.service.IAddressService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2015/3/11.
 */
@Service
public class AddressService implements IAddressService{

    @Resource
    private IAddressDao addressDao;

    @Override
    public void add(Address address) {
        addressDao.add(address);
    }

    @Override
    public List<Address> loadUserAdresss(int userId) {
        return addressDao.findUserAddress(userId);
    }

    @Override
    public void delete(int addressId) {
        addressDao.delete(addressId);
    }

    @Override
    public Address findAddressById(int addressId) {
        return addressDao.load(addressId);
    }

    @Override
    public void update(Address address) {
        addressDao.update(address);
    }
}
